/*
 * Copyright (c) 2023 iQi.Co.Ltd. All rights reserved.
 */
 
using System.Collections.Generic;
using NetProtocol.POD;
using NetProtocol.Enum;
using IQIGame.Onigao.Game;
using IQIGame.Onigao.GamePlay;
using IQIGame.Onigao.Framework;
using System.Threading.Tasks;
using System;

namespace NetProtocol.Server {
	/// <summary>
	/// 运营活动模块
	/// module : operationsEvent
	/// </summary>
	public interface SNetOperationsEvent : INetServerModule {
		Dictionary<int, MessageHandler> INetServerModule.GetModuleFunction()
        {	
            return new()
            {
            };
        }
        
        Dictionary<int, Func<IReceiveMessage>> INetServerModule.GetModuleRequest() 
        {
	        return new ()
	        {
	        };
	    }
        
#region Server-side Interface
#endregion
#region Client-side Interface
		/// <summary>
        /// 
        /// </summary>
		public bool SC_notifyAllEventStatus(ISession session, List<OperationEventPOD> list){
	        return NetProtocolHelper.SendMessage(session, new NotifyAllEventStatus(list));
	    }
	    public void SC_notifyAllEventStatus_Broadcast(List<ISession> sessions, List<OperationEventPOD> list){
	        NetProtocolHelper.BroadcastMessage(sessions, new NotifyAllEventStatus(list));
	    }
		/// <summary>
        /// 
        /// </summary>
		public bool SC_notifyOperationsEventData(ISession session, OperationEventDataPOD pod){
	        return NetProtocolHelper.SendMessage(session, new NotifyOperationsEventData(pod));
	    }
	    public void SC_notifyOperationsEventData_Broadcast(List<ISession> sessions, OperationEventDataPOD pod){
	        NetProtocolHelper.BroadcastMessage(sessions, new NotifyOperationsEventData(pod));
	    }
#endregion

#region Messages
	public class NotifyAllEventStatus : MessageNotify {
		private List<OperationEventPOD> list;
		public NotifyAllEventStatus(List<OperationEventPOD> list) {
		    this.list = list == null ? null : new (list);
		}
		public override int GetMessageId() {return NetMessageId.operationsEvent_notifyAllEventStatus;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.operationsEvent_notifyAllEventStatus;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_list_pod(list);
			return si_p;
		}
		public override string ToString() {
			return "OperationsEvent.SC_notifyAllEventStatus { "
			+ "list="
			+ list.ToString<OperationEventPOD>()
			+" }";
		}
	}
	public class NotifyOperationsEventData : MessageNotify {
		private OperationEventDataPOD pod;
		public NotifyOperationsEventData(OperationEventDataPOD pod) {
		    this.pod = pod;
		}
		public override int GetMessageId() {return NetMessageId.operationsEvent_notifyOperationsEventData;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.operationsEvent_notifyOperationsEventData;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_pod(pod);
			return si_p;
		}
		public override string ToString() {
			return "OperationsEvent.SC_notifyOperationsEventData { "
			+ "pod="
			+ pod
			+" }";
		}
	}
	}
#endregion
}